# RT-Thread building script for component

from building import *

cwd     = GetCurrentDir()
src     = []
CPPPATH = [cwd]

if GetDepend(['BSP_USING_EPAPER']):
	src += ['DEV_Config.c']
	src += ['EPD_4in2b_V2.c']
	src += ['GUI_Paint.c']

if GetDepend(['BSP_USING_EPAPER_TEST']):
	src += ['EPD_4in2b_V2_test.c']

if GetDepend(['BSP_USING_FONTS']):
	src += ['Fonts/font8.c']
	src += ['Fonts/font12.c']
	src += ['Fonts/font16.c']
	src += ['Fonts/font20.c']
	src += ['Fonts/font24.c']

if GetDepend(['BSP_USING_EPAPER']):
	src += ['SPI_RAM.c']

group = DefineGroup('epaper', src, depend = [''], CPPPATH = CPPPATH)

objs = [group]

list = os.listdir(cwd)

for item in list:
    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
        objs = objs + SConscript(os.path.join(item, 'SConscript'))

Return('objs')
